
import { showNotify } from 'vant'
import worn_path from '~/worn.mp3'; 
// showFailToast
export const AppToast = (msg: string, type = 'success',audio=false) => {
    if (type === 'success') {
        showNotify({
            type: 'success',
            message: msg,
            duration: 500,
        })
    } else {
        if(audio){ 
            const player = new Audio(worn_path);
            player.play();
        }
        showNotify({
            type: 'danger',
            message: msg
        })
    }
}